home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / gfx / nsITheme.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  119 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is the Mozilla browser.
  17.  *
  18.  * The Initial Developer of the Original Code is
  19.  * Netscape Communications Corporation.
  20.  * Portions created by the Initial Developer are Copyright (C) 1999
  21.  * the Initial Developer. All Rights Reserved.
  22.  *
  23.  * Contributor(s):
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  27.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38.  
  39. #ifndef nsITheme_h_
  40. #define nsITheme_h_
  41.  
  42. #include "nsISupports.h"
  43. #include "nsCOMPtr.h"
  44. #include "nsColor.h"
  45.  
  46. struct nsRect;
  47. struct nsSize;
  48. struct nsFont;
  49. struct nsMargin;
  50. class nsPresContext;
  51. class nsIRenderingContext;
  52. class nsIDeviceContext;
  53. class nsIFrame;
  54. class nsIContent;
  55. class nsIAtom;
  56.  
  57. // IID for the nsITheme interface
  58. // {75220e36-b77a-464c-bd82-988cf86391cc}
  59. #define NS_ITHEME_IID     \
  60. { 0x75220e36, 0xb77a, 0x464c, { 0xbd, 0x82, 0x98, 0x8c, 0xf8, 0x63, 0x91, 0xcc } }
  61.  
  62. // {D930E29B-6909-44e5-AB4B-AF10D6923705}
  63. #define NS_THEMERENDERER_CID \
  64. { 0xd930e29b, 0x6909, 0x44e5, { 0xab, 0x4b, 0xaf, 0x10, 0xd6, 0x92, 0x37, 0x5 } }
  65.  
  66. class nsITheme: public nsISupports {
  67. public:
  68.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITHEME_IID)
  69.   
  70.   NS_IMETHOD DrawWidgetBackground(nsIRenderingContext* aContext,
  71.                                   nsIFrame* aFrame,
  72.                                   PRUint8 aWidgetType,
  73.                                   const nsRect& aRect,
  74.                                   const nsRect& aClipRect)=0;
  75.  
  76.   NS_IMETHOD GetWidgetBorder(nsIDeviceContext* aContext, 
  77.                              nsIFrame* aFrame,
  78.                              PRUint8 aWidgetType,
  79.                              nsMargin* aResult)=0;
  80.  
  81.   // This method can return PR_FALSE to indicate that the CSS padding value
  82.   // should be used.  Otherwise, it will fill in aResult with the desired
  83.   // padding and return PR_TRUE.
  84.   virtual PRBool GetWidgetPadding(nsIDeviceContext* aContext,
  85.                                   nsIFrame* aFrame,
  86.                                   PRUint8 aWidgetType,
  87.                                   nsMargin* aResult) = 0;
  88.  
  89.   // This method can return PR_FALSE to indicate that no special overflow
  90.   // area is required by the native widget. Otherwise it will fill in
  91.   // aResult with the desired overflow area and return PR_TRUE.
  92.   virtual PRBool GetWidgetOverflow(nsIDeviceContext* aContext,
  93.                                    nsIFrame* aFrame,
  94.                                    PRUint8 aWidgetType,
  95.                                    nsRect* aResult)
  96.   { return PR_FALSE; }
  97.  
  98.   NS_IMETHOD GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame* aFrame,
  99.                                   PRUint8 aWidgetType,
  100.                                   nsSize* aResult,
  101.                                   PRBool* aIsOverridable)=0;
  102.  
  103.   NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, 
  104.                                 nsIAtom* aAttribute, PRBool* aShouldRepaint)=0;
  105.  
  106.   NS_IMETHOD ThemeChanged()=0;
  107.  
  108.   virtual PRBool ThemeSupportsWidget(nsPresContext* aPresContext,
  109.                                      nsIFrame* aFrame,
  110.                                      PRUint8 aWidgetType)=0;
  111.  
  112.   virtual PRBool WidgetIsContainer(PRUint8 aWidgetType)=0;
  113. };
  114.  
  115. // Creator function
  116. extern NS_METHOD NS_NewNativeTheme(nsISupports *aOuter, REFNSIID aIID, void **aResult);
  117.  
  118. #endif
  119.